<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="css/layui.css" media="all">
</head>
<body>
	<form class="layui-form" onsubmit="return false">

		<div class="layui-inline">
			<label class="layui-form-label">员工编号:</label>
			<div class="layui-input-block">
				<input type="text" name="empno" 
					autocomplete="off" placeholder="请输入..." class="layui-input">
			</div>
		</div>
		<br> <br> <br>
		<div class="layui-inline">
			<label class="layui-form-label">员工姓名:</label>
			<div class="layui-input-block">
				<input type="text" name="ename" 
					autocomplete="off" placeholder="请输入..." class="layui-input">
			</div>
		</div>
		<br> <br> <br>
		<div class="layui-inline">
			<label class="layui-form-label">员工职位:</label>
			<div class="layui-input-block">
				<input type="text" name="job"  autocomplete="off"
					placeholder="请输入..." class="layui-input">
			</div>
		</div>
		  <div class="layui-inline">
      <label class="layui-form-label">入职日期:</label>
      <div class="layui-input-inline">
        <input type="text" name="hiredate" id="date"  placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
      </div>
    </div>
		<br> <br> <br>
		<div class="layui-inline">
			<label class="layui-form-label">员工工资:</label>
			<div class="layui-input-block">
				<input type="text" name="sal"  autocomplete="off"
					placeholder="请输入..." class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">员工奖金:</label>
			<div class="layui-input-block">
				<input type="text" name="comm"  autocomplete="off"
					placeholder="请输入..." class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">工资证照:</label>
			<div class="layui-input-block">
				<input type="text" name="id_photo" 
					autocomplete="off" placeholder="请输入..." class="layui-input">
			</div>
		</div>
		<br> <br> <br>
		<div class="layui-form-item">
			<label class="layui-form-label">部门名:</label>
			<div class="layui-input-block">
				<select name="dept_id" >
					<option value="" selected="">请选择</option>
					<option value="1">财务</option>
					<option value="2">人事</option>
					<option value="3">ceo</option>
				</select>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-input-block">
				<button type="submit" class="layui-btn" 
					>立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>
	<script type="text/javascript" src="layui.js"></script>
	<script type="text/javascript" src="lay/jquery.min.js"></script>
	<script type="text/javascript">
		layui
				.use(
						[ 'form', 'layedit', 'laydate', 'upload' ],
						function() {
							var form = layui.form, layer = layui.layer, layedit = layui.layedit, laydate = layui.laydate;
							//日期
							laydate.render({
								elem : '#date'
							});
							laydate.render({
								elem : '#date1'
							});
						});
	</script>
	<script type="text/javascript">
		$(function() {
			$(".layui-form").submit(function() {
				$.post(
						"add", 
						$(this).serialize(),
						function(data) {
					if (data.success) {
						layer.msg("添加成功");
						window.parent.location.reload();
					} else {
						layer.msg("添加失败");
					}
				})
			})
		})
	</script>
</body>
</html>